package com.example.redis.demo.util;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class PasswordUtil {


    private static final BCryptPasswordEncoder ENCODER = new BCryptPasswordEncoder(12);

    private PasswordUtil() {

    }


    public static String encrypt(String plainText) {
        return ENCODER.encode(plainText);
    }

    public static boolean matches(String plainText, String encryptPassword) {
        return ENCODER.matches(plainText, encryptPassword);
    }


}

